import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
import moment from 'moment'
import VConsole from 'vconsole'
import "./router/permission";
// import piniaPluginPersist from 'pinia-plugin-persist'

// console.log(import.meta);
if (import.meta.env.VITE_APP_ENV == 'testing') new VConsole()

import { createPinia } from 'pinia'

const pinia = createPinia()
// pinia.use(piniaPluginPersist);
import {
  Search,
  Grid,
  GridItem,
  Skeleton,
  SkeletonTitle,
  SkeletonImage,
  SkeletonAvatar,
  SkeletonParagraph,
  Sticky,
  Image as VanImage,
  Rate,
  Icon,
  Empty,
  List,
  PullRefresh,
  Overlay,
  Loading,
  Divider,
  Swipe,
  SwipeItem,
  ImagePreview,
  NavBar,
  Circle,
  Progress,
  Popup,
  DatePicker,
  BackTop, Tab, Tabs, Button, Calendar, Cell, Toast
} from 'vant';
import 'vant/lib/index.css';
import './style.css'

const app = createApp(App);
app.use(router).use(pinia).use(moment).mount('#app');
app.use(Search)
  .use(Grid)
  .use(GridItem)
  .use(Skeleton)
  .use(SkeletonTitle)
  .use(SkeletonImage)
  .use(SkeletonAvatar)
  .use(SkeletonParagraph)
  .use(Sticky)
  .use(VanImage)
  .use(Rate)
  .use(Icon)
  .use(Empty)
  .use(List)
  .use(PullRefresh)
  .use(Overlay)
  .use(Loading)
  .use(Divider)
  .use(Swipe)
  .use(SwipeItem)
  .use(ImagePreview)
  .use(Button)
  .use(Cell)
  .use(Toast)
  .use(NavBar)
  .use(Circle)
  .use(Progress)
  .use(Popup)
  .use(DatePicker)
  .use(BackTop).use(Tab).use(Tabs).use(Calendar)
